[JAX-B] How can I ignore a superclass?
Posted
by MrSpandex
on Stack Overflow
See other posts from Stack Overflow
or by MrSpandex
Published on 2009-09-06T17:30:07Z
Indexed on
2010/05/16
1:40 UTC
Read the original article
Hit count: 298
I'm trying to write a web service for the java.util.logging
api. So I wrote a class MyLogRecord that inherits from LogRecord. I annotated this class with JAX-B annotations, including @XmlAccessorType(XmlAccessType.NONE)
so it would ignore non-annotated fields and properties. When I start up tomcat, I get errors that java.util.logging.Level
and other java.util.logging
classes do not have a default constructor, but none of my annotated methods make any reference to the Level class or any of the other java.util.logging
classes. These are referenced by the parent class.
My sub-class has everything it needs defined. How can I get JAX-B to ignore the parent class completely?
Update: I found another post on this, which suggests modifying the parent class. This is obviously not possible because I am extending a java.util
class. IS there any way to do this without modifying the superclass?
Update2: I found a thread on java.net for a similar problem. That thread resulted in an enhancement request, which was marked as a duplicate of another issue, which resulted in the @XmlTransient
annotation. The comments on these bug reports lead me to believe this is impossible in the current spec.
© Stack Overflow or respective owner